package com.of.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration
public class SwaggerConfig {
    @Bean
    public Docket getDocket() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(swaggerDemoApiInfo())
                .select()
                .build();
    }

    private ApiInfo swaggerDemoApiInfo() {

        return new ApiInfoBuilder()
                .contact(new Contact("点餐应用",
                        "http://localhost:8089/",
                        "2477147724@qq.com"))
                .title("点餐系统").build();
    }
}
